//package com.yyl.render.utils
//
//import androidx.lifecycle.Lifecycle
//import androidx.lifecycle.LifecycleEventObserver
//import androidx.lifecycle.LifecycleOwner
//
//open class LifeObserver : LifecycleEventObserver {
//
//    override fun onStateChanged(source: LifecycleOwner, event: Lifecycle.Event) {
//        onAny(source, event)
//        when (event) {
//            Lifecycle.Event.ON_START -> onStart()
//            Lifecycle.Event.ON_CREATE -> onCreate()
//            Lifecycle.Event.ON_RESUME -> onResume()
//            Lifecycle.Event.ON_PAUSE -> onPause()
//            Lifecycle.Event.ON_STOP -> onStop()
//            Lifecycle.Event.ON_DESTROY -> onDestroy()
//            else -> {
//            }
//        }
//        if (event == Lifecycle.Event.ON_DESTROY) {
//            source.lifecycle.removeObserver(this)
//        }
//    }
//
//    open fun onCreate() {}
//
//    open fun onStart() {}
//
//    open fun onResume() {}
//
//    open fun onPause() {}
//
//    open fun onStop() {}
//
//    open fun onDestroy() {}
//
//    open fun onAny(source: LifecycleOwner, event: Lifecycle.Event) {}
//}
